home *** CD-ROM | disk | FTP | other *** search
/ SGI Hot Mix 17 / Hot Mix 17.iso / HM17_SGI / research / lib / obsolete / set_screen.pro < prev    next >
Text File  |  1997-07-08  |  1KB  |  64 lines

  1. ; $Id: set_screen.pro,v 1.2 1997/01/15 04:02:19 ali Exp $
  2. ;
  3. ; Copyright (c) 1989-1997, Research Systems, Inc.  All rights reserved.
  4. ;       Unauthorized reproduction prohibited.
  5.  
  6. pro set_screen, xmin, xmax, ymin, ymax
  7. ;+
  8. ; NAME:
  9. ;    SET_SCREEN
  10. ;
  11. ; PURPOSE:
  12. ;    Emulate the Version I VMS/IDL SET_SCREEN procedure.
  13. ;    Sets the default position and size of the plot data window.
  14. ;    Uses device coordinates, rather than normalized coords.
  15. ;
  16. ; CATEGORY:
  17. ;    Plotting.
  18. ;
  19. ; CALLING SEQUENCE:
  20. ;    SET_SCREEN, Xmin, Xmax [, Ymin, Ymax]
  21. ;
  22. ; INPUTS:
  23. ;    Xmin:    Minimum X device coordinate of the plotting data window.
  24. ;
  25. ;    Xmax:    Maximum X device coordinate of the plotting data window.
  26. ;
  27. ; OPTIONAL INPUT PARAMETERS:
  28. ;    Ymin:    Minimum Y device coordinate of the plotting data window.
  29. ;
  30. ;    Ymax:    Maximum Y device coordinate of the plotting data window.
  31. ;
  32. ; KEYWORD PARAMETERS:
  33. ;    None.
  34. ;
  35. ; OUTPUTS:
  36. ;    No explicit outputs.
  37. ;
  38. ; COMMON BLOCKS:
  39. ;    None.
  40. ;
  41. ; SIDE EFFECTS:
  42. ;    The system variable !P.POSITION is set.
  43. ;
  44. ; RESTRICTIONS:
  45. ;    None.
  46. ;
  47. ; PROCEDURE:
  48. ;    Straightforward.  !P.POSITION is directly set.
  49. ;
  50. ; MODIFICATION HISTORY:
  51. ;    DMS, June, 1989.
  52. ;-
  53. on_error, 2        ;Return to caller in case of error
  54. n = n_params()
  55. if n le 2 then begin    ;Calculate Ymin and Ymax
  56.     y = !x.margin * !d.x_ch_size ;Margins in device coords
  57.     ymin = y(0)
  58.     ymax = !d.y_size - y(1)
  59.     endif
  60. xs = float(!d.x_size)    ;Scale factors
  61. ys = float(!d.y_size)
  62. !p.position = [ xmin/xs, ymin/ys, xmax/xs, ymax/ys] ;Set it
  63. end
  64.